#ifndef HFM_TREE_H_
#define HFM_TREE_H_

#include"HFM_Node.h"
#include<string>
using std::string;

class HFM_Tree {

public:
	HFM_Tree();
	~HFM_Tree();

	Status HFM_Code();
	Status texttoInts();
	int toInt(string, int);
	Status Intstotext();
	string tostr(int);
	char findChar(string &,int &);

	HFM_Node *getBase();
	int *getStatistic();
	int	getdifferNum();
	int getTotalNum();
	int getByteNum();
	string **getPtrtoCode();
	string *getText();
	int *getInts();

	Status setBase(HFM_Node *);
	Status setStatistic(int *);
	Status setdifferNum(int);
	Status setTotalNum(int);
	Status setByteNum(int);
	Status setPtrtoCode(string **);
	Status append(char);
	Status setInts(int *);

private :
	Status createTree();

private:
	string *text;
	HFM_Node *m_pBase;
	int *m_pStatistic;
	int m_idifferNum;		//the number of different character
	int m_iTotalNum;		//the total number of character
	int m_iByteNum;
	string **m_pCode;
	int *m_iInts;
};

#endif